package com.weitu.permission.district.service.impl;

import com.weitu.permission.district.entity.County;
import com.weitu.permission.district.mapper.CountyMapper;
import com.weitu.permission.district.service.CountyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CountyServiceImpl implements CountyService {
    private final CountyMapper countyMapper;

    private static final Logger logger = LoggerFactory.getLogger(CountyServiceImpl.class);

    @Autowired
    public CountyServiceImpl(CountyMapper countyMapper) {
        this.countyMapper = countyMapper;
    }

    @Override
    public County selectByPrimaryKey(String code) {
        return this.countyMapper.selectByPrimaryKey(code);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String code) {
        return this.countyMapper.deleteByPrimaryKey(code);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(County record) {
        return this.countyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int insertSelective(County record) {
        return this.countyMapper.insertSelective(record);
    }

    @Override
    public List<County> queryList(String parentCode, String code) {
        return this.countyMapper.queryList(parentCode, code);
    }
}